import { createRouter, createWebHistory } from 'vue-router';
//导入组件
import LoginVue from '@/views/Login.vue';
import LayoutVue from '@/views/Layout.vue';
import UserManageVue from '@/views/book/UserManage.vue';
import TrafficPathManageVue from '@/views/book/TrafficPathManage.vue';
import TravelVue from '@/views/book/Travel.vue';
import UserInfoVue from '@/views/user/UserInfo.vue';
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue';
import UserAvatarVue from '@/views/user/UserAvatar.vue';

import PathCheckVue from '@/views/book/PathCheck.vue';
import PersonSchedulVue from '@/views/book/PersonSchedul.vue';
import CheckResultVue1 from '@/views/book/CheckResult1.vue';
import CheckResultVue2 from '@/views/book/CheckResult2.vue';
import CheckResultVue3 from '@/views/book/CheckResult3.vue';
import CheckResultVue4 from '@/views/book/CheckResult4.vue';
import CheckResultVue5 from '@/views/book/CheckResult5.vue';
import EvaluateCenterVue from '@/views/book/EvaluateCenter.vue';
//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', component: LayoutVue,
        redirect: '/travel', //重定向
        children: [
            { path: '/user/manage', component: UserManageVue },
            { path: '/path/manage', component: TrafficPathManageVue },
            { path: '/path/check', component: PathCheckVue },
            { path: '/person/schedul', component: PersonSchedulVue },
            { path: '/check/result1', component: CheckResultVue1 },
            { path: '/check/result2', component: CheckResultVue2 },
            { path: '/check/result3', component: CheckResultVue3 },
            { path: '/check/result4', component: CheckResultVue4 },
            { path: '/check/result5', component: CheckResultVue5 },
            { path: '/evaluate/center', component: EvaluateCenterVue },
            { path: '/travel', component: TravelVue },
            { path: '/user/info', component: UserInfoVue },
            { path: '/user/resetPassword', component: UserResetPasswordVue },
            { path: '/user/avatar', component: UserAvatarVue },
        ]
    },
]
//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})
//导出路由
export default router